%Time interval for sim
Vm = [0:0.01:10];
scaling_fac = 400;
%Channels
gNa = ((Vm-3).^3 + 25)./scaling_fac; %Sodium is a cubic

gKir = Vm;
gKir(find(Vm<4)) = 0.0;
gKir(find(Vm>=4)) = (Vm(find(Vm>=4))-4).^2.5;
gKir = gKir./scaling_fac;

gCa = Vm;
gCa(find(Vm<4)) = 0.0;
gCa(find(Vm>=4)) = (Vm(find(Vm>=4))-3).^2/3;
gCa = gCa./scaling_fac;


figure; hold on;
plot(Vm, gNa, 'b');
plot(Vm, gKir, 'r');
plot(Vm, gCa, 'g');
plot(Vm, gNa+gCa - gKir, 'k');
axis tight;